FROM hub.docker.alibaba-inc.com/aone-base-global/alios7-nodejs:1.0

EXPOSE 80
EXPOSE 6001
ENV PATH="${PATH}:/home/admin/ohpm-repo/target/ohpm-repo/node_modules/.bin"

RUN yum install -y nfs-utils

RUN mkdir -p /home/admin/ohpm-repo/target/ && \
cp -rf /home/admin/appname/bin /home/admin/ohpm-repo

WORKDIR /home/admin/ohpm-repo/bin

VOLUME /home/admin/logs /home/admin/cai/logs /home/admin/ohpm-repo/logs /home/a/vipsrv-dns/vipsrv-cache

COPY environment/nginx/* /home/admin/cai/conf/
COPY environment/scripts/*.sh /home/admin/

RUN chmod +x /home/admin/*.sh

RUN echo "/home/admin/ohpm-repo/bin/nodejsctl pubstart" >> /home/admin/start.sh
ENTRYPOINT ["/home/admin/start.sh"]
COPY ohpm-repo.tgz /home/admin/ohpm-repo/target/ohpm-repo.tgz
